 
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    radio:'1',
    showDate:false,
    date:'请选择',
    minDate: new Date().getTime(),
    maxDate: 2527171200000,
    ztPrice:{},
  },  
  attached(){
     console.log("组件进入时渲染", app.globalData.ztPrice  );
     this.setData({ ztPrice: app.globalData.ztPrice,
      radio : app.globalData.payRentType,
      date:  app.globalData.ztPrice.settledTime  });
  }, 
  methods: {
    onChange(e){ 
      this.setData({ radio:e.detail })
      app.globalData.ztPrice.payRentType = e.detail
    },
    formatDate(date) {
      date = date?new Date(date):new Date();
      return `${date.getFullYear() }年${date.getMonth() + 1}月${date.getDate()}日`;
    },
    onConfirm(event) {
      console.log(event.detail);
      var date = this.formatDate(event.detail);
      this.setData({ showDate: false, date: date,});
      app.globalData.ztPrice.settledTime	= date;
    },
  }
})
